﻿using System;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
using DevExpress.ExpressApp;
using System.ComponentModel;
using DevExpress.ExpressApp.DC;
using DevExpress.Data.Filtering;
using DevExpress.Persistent.Base;
using System.Collections.Generic;
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;

namespace Tida.Module.BusinessObjects.系统管理
{
    [NonPersistent]
    public abstract class BaseInf : BaseObject
    { // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113146.aspx).

        public BaseInf(Session session)
             : base(session)
        {

        }

        public override void AfterConstruction()
        {

            修改人 = Session.GetObjectByKey<Sys_User>(SecuritySystem.CurrentUserId);
            创建人 = Session.GetObjectByKey<Sys_User>(SecuritySystem.CurrentUserId);
            创建时间 = System.DateTime.Now;
            修改时间 = System.DateTime.Now;
        }

        // Fields...

        private DateTime _修改时间;


        private DateTime _创建时间;
        [ModelDefault("AllowEdit", "false")]
        public DateTime 创建时间
        {
            get
            {
                return _创建时间;
            }
            set
            {
                SetPropertyValue("创建时间", ref _创建时间, value);
            }
        }

        [ModelDefault("AllowEdit", "false")]
        public DateTime 修改时间
        {
            get
            {
                return _修改时间;
            }
            set
            {
                SetPropertyValue("修改时间", ref _修改时间, value);
            }
        }

        [ModelDefault("AllowEdit", "false")]
        public Sys_User 创建人;

        [ModelDefault("AllowEdit", "false")]

        public Sys_User 修改人;

    }
}